package com.lagou.edu.controller;

import com.lagou.edu.anno.Autowired;
import com.lagou.edu.pojo.Account;
import com.lagou.edu.service.UserService;

/**
 * @author HZF
 * @date 2020/5/31 9:03
 * @description
 */
public class UserController {

    @Autowired
    private UserService userService;

    public void save(){
        userService.save();
    }

    public Account queryAccount(String carNo) throws Exception {
        Account account = userService.queryOne(carNo);
        return account;
    }

    public int updateAccount(Account account) throws Exception {
        int i = userService.updateAccount(account);
        return i;
    }

    public void updateAccount2(String fromCardNo, String toCardNo, int money) throws Exception {
        userService.transfer(fromCardNo,toCardNo,money);
    }
}
